package com.starbug.rabbitmq.springbootrabbitmq.consumer;

import com.starbug.rabbitmq.springbootrabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 *  @Author Starbug
 *  @Date 2021/6/25 23:15
 */
@Slf4j
@Component
public class Consumer {

    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveConfirm(Message message) {
        String msg = new String(message.getBody());
        log.info("接收到消息:{}", msg);
    }

}
